package map;

import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class HashMapDemo {
	public static void putKeyValue(Map<String, String> map) {
		map.put("Zara", "8");
		map.put("Mahnaz", "31");
		map.put("Ayan", "12");
		map.put("Daisy", "14");
	}
	
	public static void iteKey(Map<String, String> hMap) {
		Collection<String> c = hMap.keySet();
		Iterator<String> ite = c.iterator();
		while(ite.hasNext()) {
			System.out.println(ite.next());
		}
	}
	
	public static void iteValue(Map<String, String> hMap) {
		Collection<String> c = hMap.values();
		Iterator<String> ite = c.iterator();
		while(ite.hasNext()) {
			System.out.println(ite.next());
		}
	}

	public static void main(String[] args) {
		Map<String, String> map = new HashMap<String, String>();

		putKeyValue(map);
		iteKey(map);
		iteValue(map);
	}
}
